package chap7;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class BuyCloth {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int c=0;
        for(int i=1;i<=5;i++){
            System.out.println("来到了第"+i+"家店");
            for(int j=1;j<=3;j++){
                System.out.println("要离开？");
                String answer=sc.next();
                if(answer.equals("y")){
                    System.out.println("结账离开");
                    break;
                }
                System.out.println("买了一件");
                c++;
            }

        }
        System.out.println("今天总共买了"+c+"件！");
    }
}
